package mymatrix;

import result.Result;
import tasks.Task;

public class MatrixMultTask extends Task{

//	private int size;
	private int line;
	private long[] vector;
	private long[][] matrix;
	long [] resultVector;

	public MatrixMultTask(int id, int line, int size, long[] vector, long[][] matrix) {
		super(id);
//		this.size = size;
		this.line = line;
		this.vector = vector;
		this.matrix = matrix;
		
	}


	@Override
	public void run() {
		resultVector = new long[vector.length];
		for(int i = 0; i < vector.length; i++) {
			for(int j = 0; j <vector.length; j++) 
				resultVector[i] += vector[j]*matrix[j][i];
		}

	}  


	@Override
	public Result getResult() {
		return new MultResut(line,resultVector);
	}

	@Override
	public void cancel() {
		// TODO Auto-generated method stub

	}

}
